<template>
  <div class="about">
    <!-- {{details}} -->
    <div>{{details.title}}</div>
    <!-- 显示具有html格式的内容 -->
    <div v-html='details.content'></div>
    <div v-if='details.category'>{{details.category.name}}</div>
  </div>
</template>
<script>
// 导入axios
import axios from '@/http/axios'
export default {
  data(){
    return{
      details:[]
    }
  },
  created(){
    // console.log(this.$route.params.id)
    this.findDetail( this.$route.query.id)
  },
  methods:{
    findDetail(id){
      var obj={
        id:id
      }
      axios({
        url:'http://121.199.29.84:8001/article/findById',
        
        method:'get',
        params:obj

      }).then((res)=>{
        // console.log(res.data.data)
        this.details=res.data.data
      })
    }
  }
}
</script>